<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>insert title here</title>
</head>
<body>
  <input name="but" type="button" value="点我吧" onclick="fun()">;
  <input class="clsName" name="but2" id="but3" type="button" value="我被绑定了">;
</body>
 <script>
   //1.直接html中调用 耦合度高的调用
   let fun=function (){
     alert("点我干啥");
   }
   //2. 事件绑定
   //id绑定返回独一时间
    let ebc = document.getElementById("but3")
   //class绑定返回一组事件
    let ebcn = document.getElementsByClassName("clsName");
   document.getElementsByName("but2")
    document.write(ebcn.length.toString())
    console.log(ebcn.item(0))

   ebc.onclick=function () {
       alert.log("我是事件绑定");
   }
   //url编码
   let s="高圆圆"
   var s1 = encodeURI(s);
   console.log(s1);//转换成电脑识别%E9%AB%98%E5%9C%86%E5%9C%86
   //url解码
   var s2 = decodeURI(s1);
   console.log(s2);//解码 高圆圆
 </script>
</html>